﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class OJobJinKouAdd : PageBase
    {

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.机器库存一览表_进口新增 };
            }
        }

        protected override string DWZRef
        {
            get { return "OJobList"; }
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "addjob")
            {
                addmenu();
            }
        }

        protected void addmenu()
        {
            string MachineType=GetRequestValue<string>("MachineType","");
            string SerialNumber=GetRequestValue<string>("SerialNumber","");
            DateTime DownlineDate = GetRequestValue<DateTime>("DownlineDate");



            int r = OJobJinKouController.Add(MachineType,SerialNumber,DownlineDate);

           // this.AddLog(Permission.新增, null, obj);
            
            if (r > 0)
            {
                SuccessJson("添加成功", this.DWZRef);
            }
            else
            {
                ErrorJson("添加失败", this.DWZRef);
            }
        }
    }
}